﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Web;

namespace JTicket.UI.Extention.IHandler
{
    public class RquestHandler : IHttpHandler
    {

        #region IHttpHandler 成员

        public bool IsReusable
        {
            get { return false; }
        }

        public void ProcessRequest(HttpContext context)
        {
            HttpRequest request = context.Request;
            HttpResponse response = context.Response;
            int pges = 1;
            List<Model.I_Requirement> list =
                DAL.I_Requirement.GetList(0, 300, ref pges);
            int fg = list.Count;
            response.Write("[");
            if (fg > 0)
            {
                foreach (var x in list)
                {
                    response.Write(JsonHelper.ObjectToJson(x));
                    if (--fg > 0)
                    {
                        response.Write(",");
                    }
                }

            }
            response.Write("]");
            response.End();
        }
        #endregion
    }
    public class BoardHandler : IHttpHandler
    {
        #region IHttpHandler Members

        public bool IsReusable
        {
            get { throw new NotImplementedException(); }
        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="context"></param>
        public void ProcessRequest(HttpContext context)
        {
            HttpRequest request = context.Request;
            HttpResponse response = context.Response;
            string[] IdList = request.QueryString["IdList"].TrimEnd('|').Split('|');
            foreach (var id in IdList)
            {
                BLL.D_Boardinfo.Delete(int.Parse(id));
            }
        }
        #endregion
    }



    public class BoardAddHandler : IHttpHandler
    {
        #region IHttpHandler Members

        public bool IsReusable
        {
            get { throw new NotImplementedException(); }
        }

        public void ProcessRequest(HttpContext context)
        {
           
        }

        #endregion
    }



}
